Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize the account deletion process #4726

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

nick-funk
Copy link
Contributor

@nick-funk nick-funk commented Jan 28, 2025

What does this PR do?

  • do not update comment actions (recs) as it is unnecessary
  • use an appropriate index with conditional moderation to dramatically speed up the moderation process and cursor retrieval for large comment collections

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

N/A

How do I test this PR?

  • ensure that DISABLE_JOB_PROCESSORS is set to false in your .env
    • user deletion is processed as a job
    • if using pnpm run start:development use pnpm run start:development:withJobs instead
  • enable user deletion in Admin > Config
  • create a new user to delete
  • post some comments
    • recommended that you also have another user reply to some of their comments
    • different things happen if a deleted comment has children or not
  • schedule the user for deletion
    • use account options for deletion in stream tabs
  • modify the scheduled deletion date for the user in Mongo
  • let the job run
    • may want to modify the job schedule to run more frequently via server/src/core/server/cron/accountDeletion.ts
      const job = new ScheduledJob(options, {
        name: `Twice Hourly ${NAME}`,
        cronTime: "0,30 * * * *",
        command: deleteScheduledAccounts,
      });
      
  • see that user is deleted

Were any tests migrated to React Testing Library?

No

How do we deploy this PR?

  • merge into develop
  • issue out a release

- do not update comment actions (recs) as it is unnecessary
- use an appropriate index with conditional moderation to
  dramatically speed up the moderation process and cursor
  retrieval for large comment collections
@nick-funk nick-funk requested a review from kabeaty January 28, 2025 22:41
Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit 90a9575
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/67995d2ff32faa00089c493b

Copy link
Contributor

@kabeaty kabeaty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and works as expected!

@tessalt tessalt merged commit ca6244e into develop Jan 29, 2025
6 checks passed
@tessalt tessalt deleted the feat/optimize-account-deletion branch January 29, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants